﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Lonewolf.Entity.Migrations
{
    public partial class AliMysql : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "adminInfos",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    LoginName = table.Column<string>(nullable: true),
                    OrganizationId = table.Column<string>(nullable: true),
                    IsUse = table.Column<bool>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_adminInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "adminRoles",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    UserId = table.Column<string>(nullable: true),
                    RoleId = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_adminRoles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "loginInfos",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    LoginType = table.Column<int>(nullable: true),
                    UserId = table.Column<string>(nullable: true),
                    LoginPwd = table.Column<string>(nullable: true),
                    LoginKey = table.Column<string>(nullable: true),
                    LoginNumber = table.Column<int>(nullable: true),
                    LastLoginTime = table.Column<DateTime>(nullable: true),
                    LoginTime = table.Column<DateTime>(nullable: true),
                    LoginIp = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_loginInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "menuInfos",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    SuperiorId = table.Column<string>(nullable: true),
                    MenuLevel = table.Column<int>(nullable: true),
                    MenuName = table.Column<string>(nullable: true),
                    MenuEvent = table.Column<string>(nullable: true),
                    MenuIcon = table.Column<string>(nullable: true),
                    MenuUrl = table.Column<string>(nullable: true),
                    MenuIsUse = table.Column<string>(nullable: true),
                    MenuType = table.Column<string>(nullable: true),
                    MenuSort = table.Column<string>(nullable: true),
                    MenuHierarchy = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_menuInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "organizationInfos",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    SuperiorId = table.Column<string>(nullable: true),
                    OrganizationName = table.Column<string>(nullable: true),
                    Remark = table.Column<string>(nullable: true),
                    OrganizationLevel = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_organizationInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "roleInfos",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    RoleName = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_roleInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "roleMenus",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    LastChangeTime = table.Column<DateTime>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: false),
                    CreateUser = table.Column<string>(nullable: true),
                    RoleId = table.Column<string>(nullable: true),
                    MenuId = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_roleMenus", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "adminInfos");

            migrationBuilder.DropTable(
                name: "adminRoles");

            migrationBuilder.DropTable(
                name: "loginInfos");

            migrationBuilder.DropTable(
                name: "menuInfos");

            migrationBuilder.DropTable(
                name: "organizationInfos");

            migrationBuilder.DropTable(
                name: "roleInfos");

            migrationBuilder.DropTable(
                name: "roleMenus");
        }
    }
}
